#include "testcontrol.h"
#include "Ebn.h"
#include "EbnMonitor.h"
#include "ctrldialog.h"

#define XML_FILE "D:/proj2/model.xml"

CTestControl::CTestControl():
    CEbnModelController(0)
{
    mpMonitor = new CEbnMonitor(mpModel);
    mpCtrlDialog = new ctrlDialog(mpWorldStateManager);

}

CTestControl::~CTestControl()
{
    if (mpCtrlDialog)
    {
        delete mpCtrlDialog;
        mpCtrlDialog = NULL;
    }

    if (mpMonitor)
    {
        delete mpMonitor;
        mpMonitor = NULL;
    }
}

void CTestControl::initializeModel(void)
{
    loadModelFile(XML_FILE);

    mpMonitor->show();
    mpCtrlDialog->show();

}

void CTestControl::uninitializeModel(void)
{
    if (mpModel)
    {
        mpModel->clear();
    }


    if (mpWorldStateManager)
    {
        mpWorldStateManager->clear();
    }

    if (mpActionManager)
    {
        mpActionManager->clear();
    }

}


